package com.example.controller;


import com.example.swagger.generate.api.AdsControllerApi;
import com.example.swagger.generate.model.AdAdIdGet200Response;
import com.example.swagger.generate.model.User;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AdsController implements AdsControllerApi {
    /**
     * GET /ad/{adId} : 测试parameter in path
     * bala
     *
     * @param adId         (required)
     * @param positionName (required)
     * @return 指定类property, 自动生成response类, 也可以通过$ref自定义response类 (status code 200)
     */
    @Override
    public ResponseEntity<AdAdIdGet200Response> adAdIdGet(Integer adId, String positionName) {
        String prefix = adId + positionName;
        AdAdIdGet200Response response = AdAdIdGet200Response.builder()
                .reportId(998L).reportUrl("report.hhh.com -> ".concat(prefix)).imageUrl("image.hhh.com").build();
        return ResponseEntity.ok(response);
    }

    /**
     * PUT /delete/ad : 使用requestBody
     * 使用requestBody
     *
     * @param user (required)
     * @return success (status code 200)
     */
    @Override
    public ResponseEntity<Boolean> byRequestBody(User user) {
        return null;
    }
}
